import request from '@/config/axios'

// 关联信息 VO
export interface LinkinfoVO {
  id: string // ID
  name: string // 关联名称
  description: string // 阶段描述
  projectId: number // 项目ID
  relevanceId: number // 关联ID
}

// 关联信息 API
export const LinkinfoApi = {
  // 查询关联信息分页
  getLinkinfoPage: async (params: any) => {
    return await request.get({ url: `/pypm/linkinfo/page`, params })
  },

  // 查询关联信息详情
  getLinkinfo: async (id: number) => {
    return await request.get({ url: `/pypm/linkinfo/get?id=` + id })
  },

  // 新增关联信息
  createLinkinfo: async (data: LinkinfoVO) => {
    return await request.post({ url: `/pypm/linkinfo/create`, data })
  },

  // 修改关联信息
  updateLinkinfo: async (data: LinkinfoVO) => {
    return await request.put({ url: `/pypm/linkinfo/update`, data })
  },

  // 删除关联信息
  deleteLinkinfo: async (id: number) => {
    return await request.delete({ url: `/pypm/linkinfo/delete?id=` + id })
  },

  // 导出关联信息 Excel
  exportLinkinfo: async (params) => {
    return await request.download({ url: `/pypm/linkinfo/export-excel`, params })
  }
}